/****** Object:  Stored Procedure dbo.spr_UpdateExDBEmployeesByPK  ******/

 use [TourIS]
 GO

 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spr_UpdateExDBEmployeesByPK]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
 drop procedure [dbo].[spr_UpdateExDBEmployeesByPK]
 GO

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS OFF
 GO

 CREATE  PROCEDURE [dbo].[spr_UpdateExDBEmployeesByPK]
 (
	@orig_companyid int,
	@companyid int,
	@department varchar(50),
	@designation varchar(50),
	@orig_empid int,
	@empid int,
	@expirydate smalldatetime,
	@fullname varchar(50),
	@isactive bit,
	@login varchar(50),
	@password varchar(50)
 )

 AS

 BEGIN
	SET NOCOUNT ON
	DECLARE @Err int

	UPDATE [Employees]
	SET
		[CompanyId] = @companyid,
		[Department] = @department,
		[Designation] = @designation,
		[EmpID] = @empid,
		[ExpiryDate] = @expirydate,
		[FullName] = @fullname,
		[IsActive] = @isactive,
		[LogIn] = @login,
		[Password] = @password

	WHERE
	[CompanyId] = @orig_companyid
	AND [EmpID] = @orig_empid


	SET @Err = @@Error
	RETURN @Err
 END

 SET QUOTED_IDENTIFIER OFF
 GO
 SET ANSI_NULLS ON
 GO

